public abstract class Entity
{
  public int xpos;
  public int ypos;
  public int renderSizeX;
  public int renderSizeY;

  abstract void updatePosition(AnimationContext context);
  
  abstract void display();
  
  abstract boolean isOutsideZone();
  
  boolean checkCollision(Entity entity)
  {
    return (xpos + renderSizeX >= entity.xpos && xpos <= entity.xpos + entity.renderSizeX) &&
           (ypos + renderSizeY >= entity.ypos && ypos <= entity.ypos + entity.renderSizeY);
  }
}

